﻿using System;
using System.Web.Services;
using MonkeyShop.Web.Biz;
using MonkeyShop.Web.Models;

namespace MonkeyShop.Web.Services
{
    public partial class ProductService : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod(EnableSession = true)]
        public static object PiC(int cId)
        {
            return DesktopBuilderBiz.GetProductsInCategory(cId);
        }

        [WebMethod(EnableSession = true)]
        public static object PiCs(int cId)
        {
            //return DesktopBuilderBiz.GetProductWithDetailsInCategory(cId);
            return null;
        }

        [WebMethod(EnableSession = true)]
        public static object Save(DesktopModel desktopModel)
        {
            WebCommon.CatalogCommon.SavedDesktopModel = desktopModel;
            return new {Result = "OK"};
        }

        [WebMethod(EnableSession = true)]
        public static object Ps()
        {
            return DesktopBuilderBiz.GetDesktopProducts(WebCommon.CatalogCommon.SavedDesktopModel);
        }
    }
}